<?php
/**
 *Template Name: Contact template
 */
get_header();
get_template_part( 'slider2' );

$pageId = $post->ID;
$page 	= get_page($pageId);
?>
<script src="<?php echo get_template_directory_uri(); ?>/src/js/jquery.validate.js" type="text/javascript"></script>
<script src="<?php echo get_template_directory_uri(); ?>/src/js/jquery.updnWatermark.js" type="text/javascript"></script>
<style type="text/css">
.updnWatermark{
	height: 26px;
    line-height: 26px;
    padding: 0 10px;
    color: #A3A2A3;	
}
.bg_alert {
	width:270px;
	height:115px;
	background:url("<?php echo get_template_directory_uri(); ?>/images/bg_alert.png") no-repeat top left;
	margin:0px auto;
	padding:15px 0px 0px 83px;
	color:#000;
}
div.bg_alert #alert{
	margin:0; 
	padding:10px 25px 0 10px; 
	min-height:60px;
	font-size: 12px;
}
.bg-overlay {
    background: url("<?php echo get_template_directory_uri(); ?>/images/bg1.png") repeat scroll 0 0 transparent;
    height: 100%;
    left: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 10000;
}
</style>
<!--Popup-->
<div class="bg_alert" id="show_popup" style="display:none; position: fixed; top: 35%; left: 50%; z-index:10001; margin-left:-140px;"> <span id="f_focus" style="display:none;"></span>
  <div id="alert"></div>
  <div style="padding-left: 40px;"><a href="javascript:void(0);" onClick="close_popup();"><img src="<?php echo get_template_directory_uri(); ?>/images/bt_luk1.png" alt="" /></a></div>
</div>

<div id="bg-overlay" class="bg-overlay" style="display:none"></div>
<!--End Popup--> 
	<div class="content">
		<div class="template clear-fix" id="casestudy">
			<div class="heading clear-fix">
				<h2><?php echo $page->post_title?></h2>
			</div>
			<div id="contact-wrapper" class="clear-fix">
				<div class="contact-left">
					<img id="contact-logo-temp" src="<?php echo get_template_directory_uri(); ?>/src/images/imgLogo-1.png" alt="" id="logo-contact" />
					<?php
						$my_id = 160;
						$post = get_post($my_id); 
						echo $post->post_content
					?>
				</div>
				<div class="contact-right">
					<p>
						<?php
							$my_id = 168;
							$post = get_post($my_id); 
							echo $post->post_content
						?>
					</p>
					<div id="contact-form">
							<?php
								echo do_shortcode('[contact-form-7 id="86" title="Uden titel"]');
//								$page = apply_filters('the_content',$page->post_content);				
//								echo $page; 
							?>
					</div>
				</div>	
			</div>				
		</div>
	</div>
<script>
$(document).ready(function() {
$.updnWatermark.attachAll();//-- use for testing empty data in contact form
	
$(".wpcf7-form").addClass("frm-contact");
$("form.frm-contact").validate({
	
	errorPlacement: function(error, element) {			
	},
	invalidHandler: function(form, validator) {
	  var errors = validator.numberOfInvalids();
	  if (errors) {
		$('#alert').html(validator['errorList'][0]['message']);
		$('#bg-overlay').show();
		$('#show_popup').show();
		$('#f_focus').html(validator['errorList'][0]['element'].name);
		validator['errorList'][0]['element'].focus();
	  } else {
	  }
	},
	rules: {
		navn : "required",
		contactemail: {
			required: true,
			email: true
		}
	},
	messages: {
		navn: "Navn skal udfyldes!",
		contactemail: "Email skal udfyldes!"			
	}
});
close_popup=function(){		
	var fel=$('#f_focus').html();
	$('#bg-overlay').hide();
	$('#show_popup').hide();
	$('#' + fel ).focus();
};

click_send=function(){
	document.getElementById('send').click();
}
});

</script>	
<?php get_footer(); ?>